
//初始化数据
const initstate = {
  name: '屠宰模块',
  loginer:'普通登录'
}
//reducer
const reducer = (state = initstate, action: any) => {
  switch (action.type) {
    case 'tuzhai':
      return { ...state, name: action.data };
    case 'yangzhi':
      return { ...state, name: '养殖系统' };
    case 'edit':
      return { ...state, name: action.data };
    case 'newadd':
      return { ...state, name: action.data };
    case 'repoName':
      return { ...state, name: action.data };
    case 'productId':
      return { ...state, key: action.data, };
    case 'quantity':
      return { ...state, quantity: action.data };
    case 'repoId':
      return { ...state, repoId: action.data };
    case 'fodder-store-steps':
      return { ...state, current: action.data };
    case 'fodder-store-ref':
      return { ...state, ref: action.data };
    case 'Feed-inNumber':
      return { ...state, Number: action.data };
    case 'FeedNumber':
      return { ...state, FeedNumber: action.data };
      //登录切换
    case 'login':
      return { ...state, login: action.data };
    default:
      return state
  }
}
export default reducer
